package physics.collision;

import java.awt.geom.Rectangle2D;


/**
 * An interface describing the behaviors of 2D objects which can be collided
 * with other Collidable types.
 * 
 * @author geo4
 * 
 */
public interface Collidable {

    /**
     * Tests if this Collidable object has collided with another Collidable
     * object, and returns a CollisionEvent which contains the details about
     * this collision.
     * 
     * @param other Collidable object to check for collision with
     * @return CollisionEvent describing the orientation and involved Collidable
     *         of this collision
     */
    CollisionEvent checkCollision (Collidable other);

    /**
     * Completes whatever action this Collidable does when it is involved in a
     * collision.
     * 
     * @param collisionEvent CollisionEvent describing the collision that this
     *        object must react to
     */
    void handleCollision (CollisionEvent collisionEvent);

    /**
     * Gets the physical boundary of this collidable object, so that collisions
     * between Collidables can be tested.
     * 
     * @return the rectangular bounds of this collidable object
     */
    Rectangle2D getBounds ();

}
